String[] adj;

void clueSetup() {
  adj = loadStrings("adj.txt");
}

String adjPull(String elements)
{
  println(elements);
  String[] formula = split(elements, ":");
  String[] intermed;
  int[] elementIDs = int(formula);
  char search1 = ' ';
  char search2 = ' ';
  String full = "";
  
  for(int i = 0; i < elementIDs.length; i++)
  {
    String mid = "";
      
    switch(elementIDs[i]) {
      case 0: search1 = 'c';
        search2 = 'a';
        break;
      case 1: search1 = 'c';
        search2 = 'a';
        break;
      case 2: search1 = 'f';
        search2 = 'i';
        break;
      case 3: search1 = 'h';
        search2 = 'e';
        break;
      case 4: search1 = 'h';
        search2 = 'y';
        break;
      case 5: search1 = 'i';
        search2 = 'c';
        break;
      case 6: search1 = 's';
        search2 = 'i';
        break;
      case 7: search1 = 's';
        search2 = 'o';
        break;
      case 8: search1 = 's';
        search2 = 'u';
        break;
      case 9: search1 = 't';
        search2 = 'i';
        break;
    }
    
      for(int j = 0; j < adj.length;j++)
      { 
        if(adj[j].charAt(0) == search1 && adj[j].charAt(1) == search2)
        {
          mid = mid + adj[j] + ",";
        }
      }
      
      intermed = split(mid, ",");
      int pick = (int)random(0,intermed.length-1);
      full = full + elementIDs[i] + " " + intermed[pick] + " ";
  }
  
  return full;
}

String[] sentenceGen(String adjs, String elements) {
  String[] splitter = split(adjs, " ");
  String[] fin = new String[2];
  //String[] eleSplit = split(elements, ":");
  //int[] eleInt = int(eleSplit);
  
  println(adjs);
  
  fin[0] = "I am";
  fin[1] = "I have";
  
  for(int i = 0; i < splitter.length-1;i+=2)
  {
    if(splitter[i].equals("0") || splitter[i].equals("2") || splitter[i].equals("4") || splitter[i].equals("7") || splitter[i].equals("9"))
   { 
       fin[0] = fin[0] + " " + splitter[i+1];
       println(fin[0]);
   }
   else
   {
       fin[1] = fin[1] + " " + splitter[i+1];
       println(fin[1]);
   }
  }
  
  fin[0] = fin[0] + ".";
  fin[1] = fin[1] + " planets.";
  
  println(fin[0]);
  println(fin[1]);
  
  return fin;
}
  
